
local mt = ac.skill['暴风雪']
mt.art = [[ReplaceableTextures\CommandButtons\BTNBlizzard.blp]]
mt.targettype = "点"
mt.range = 800
mt.area = 400
mt.cool = 6
mt.damage = self:dmg_get()
mt.damage_time = 4
mt.damage_interval = 1
mt.effect_model = [[Abilities\Spells\Human\Blizzard\BlizzardTarget.mdl]]
mt.effect_count = 12
mt.damage_type = '魔法'

function mt:on_cast_shot()
    local target = self.target
    self:start_missile(target)
end

function mt:start_missile(target)
    ac.loop(self.damage_interval*1000,function(t)
        self.damage_time = self.damage_time - self.damage_interval
        if self.damage_time<self.damage_interval then
            t:remove()
        end
        self:notify('shot_missile',target)
    end)
end

function mt:shot_missile(target)
    local hero = self.owner
    local point = target:get_point()
    for a=1,self.effect_count do
        local r = (1 - math.sqrt(math.random(10000))/100) * self.area
        local p = point - {math.random(360),r}
        p:add_effect(self.effect_model):remove()
    end
    ac.wait(1000,function()
        hero:aoe_damage(point,self.area,self.damage,self.damage_type)
    end)
    
end


